package com.mfin.bom.objects;

// Generated 17 Jun, 2012 11:27:33 PM by Hibernate Tools 3.4.0.CR1

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.mfin.enumeration.LoanType;

/**
 * LoanMaster generated by hbm2java
 */
@Entity
@Table(name = "loan_master", catalog = "mfindb")
public class LoanMaster implements java.io.Serializable {

	private LoanType loanType;
	private String loanName;
	private Set<LoanPreference> loanPreferences = new HashSet<LoanPreference>(0);
	private Set<DocCharge> docCharges = new HashSet<DocCharge>(0);
	private Set<FinanceLoan> financeLoans = new HashSet<FinanceLoan>(0);

	public LoanMaster() {
	}

	public LoanMaster(LoanType loanType, String loanName,
			Set<LoanPreference> loanPreferences, Set<DocCharge> docCharges,
			Set<FinanceLoan> financeLoans) {
		this.loanType = loanType;
		this.loanName = loanName;
		this.loanPreferences = loanPreferences;
		this.docCharges = docCharges;
		this.financeLoans = financeLoans;
	}

	@Id
	@Column(name = "LOAN_TYPE", unique = true, nullable = false, length = 7)
	@Enumerated(EnumType.STRING)
	public LoanType getLoanType() {
		return this.loanType;
	}

	public void setLoanType(LoanType loanType) {
		this.loanType = loanType;
	}

	@Column(name = "LOAN_NAME", length = 50)
	public String getLoanName() {
		return this.loanName;
	}

	public void setLoanName(String loanName) {
		this.loanName = loanName;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "loanMaster")
	public Set<LoanPreference> getLoanPreferences() {
		return this.loanPreferences;
	}

	public void setLoanPreferences(Set<LoanPreference> loanPreferences) {
		this.loanPreferences = loanPreferences;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "loanMaster")
	public Set<DocCharge> getDocCharges() {
		return this.docCharges;
	}

	public void setDocCharges(Set<DocCharge> docCharges) {
		this.docCharges = docCharges;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "loanMaster")
	public Set<FinanceLoan> getFinanceLoans() {
		return this.financeLoans;
	}

	public void setFinanceLoans(Set<FinanceLoan> financeLoans) {
		this.financeLoans = financeLoans;
	}

}
